/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Herencia;

/**
 *
 * @author Ibon
 */
public class Principal {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        PlayerPiece shape = new PlayerPiece();
        shape.displayShape();
        shape.movePiece();

        PlayerPiece player = new PlayerPiece();
        TilePiece tile = new TilePiece();
        doShapes(player);
        doShapes(tile);

        //Todas las clases heredan de Object
        if (shape instanceof Object) {
            System.out.println("shape's an Object");
        }
        //IS-A
        Vehicle v = new Vehicle();
        v.pintar();
        Car c = new Car();
        c.pintar();
        Subaru s = new Subaru();
        s.pintar();
        //HAS-A
        //class A HAS-A B if code in class A has a reference to an instance of class B.
        Animal a = new Animal();       
        Horse ho = new Horse();       
        Halter ha = new Halter();        
        
        
    }
    //Cualquier subclase de la clase padre puede ser pasada como
    //argumento del tipo clase padre
    public static void doShapes(GameShape shape) {
        shape.displayShape();
    }
}
